package com.combetter.changxing.collections;

/**
 * Created by Mark.fan on 2018/5/14.
 */

public class ItemViewArg<T> {

    private final ItemViewSelector<T> selector;

    private final ItemView itemView;

    public static <T> ItemViewArg<T> of(ItemViewSelector selector) {
        return new ItemViewArg<T>(selector);
    }

    private ItemViewArg(ItemViewSelector selector) {
        itemView = new ItemView();
        this.selector = selector;
    }

    public void select(int position, T item) {
        selector.select(itemView, position, item);
    }

    public int layoutRes() {
        return itemView.layoutRes();
    }

    public int bindingVariable() {
        return itemView.bindingVariable();
    }

}
